home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / sweettim.swf / scripts / frame_8 / PlaceObject2_215_194 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2011-06-09  |  2.0 KB  |  68 lines

  1. onClipEvent(enterFrame){
  2.    if(Key.isDown(37) && _root.dispensing == false)
  3.    {
  4.       walking = true;
  5.       if(_root.jake._x > 80)
  6.       {
  7.          _root.jake.gotoAndStop("j_walkLeft");
  8.          _root.jake._x -= jakeSpeed;
  9.       }
  10.    }
  11.    else if(Key.isDown(39) && _root.dispensing == false)
  12.    {
  13.       walking = true;
  14.       if(_root.jake._x < 600)
  15.       {
  16.          _root.jake.gotoAndStop("j_walkRight");
  17.          _root.jake._x += jakeSpeed;
  18.       }
  19.    }
  20.    else if(Key.isDown(32))
  21.    {
  22.       walking = false;
  23.       if(_root.hitTill.hitTest(_root.jake.hit))
  24.       {
  25.          action = "till";
  26.       }
  27.       else if(_root.hitDis.hitTest(_root.jake.hit))
  28.       {
  29.          action = "dispenser";
  30.       }
  31.    }
  32.    else if((Key.isDown(97) || Key.isDown(98) || Key.isDown(99) || Key.isDown(100) || Key.isDown(101) || Key.isDown(102) || Key.isDown(103) || Key.isDown(104) || Key.isDown(105) || Key.isDown(49) || Key.isDown(50) || Key.isDown(51) || Key.isDown(52) || Key.isDown(53) || Key.isDown(54) || Key.isDown(55) || Key.isDown(56) || Key.isDown(57)) && _root.hitRack.hitTest(_root.jake.hit))
  33.    {
  34.       numberKey = String.fromCharCode(Key.getAscii());
  35.       trace("***************" + numberKey + "*********************");
  36.       action = "fill";
  37.       walking = false;
  38.    }
  39.    else
  40.    {
  41.       walking = false;
  42.       action = "";
  43.       actionFilled = false;
  44.       actionServed = false;
  45.       actionCollected = false;
  46.       _root.jake.gotoAndPlay(1);
  47.    }
  48.    if(action == "fill" && actionFilled == false)
  49.    {
  50.       if(_root.currentSweet > 0 && numberKey != "")
  51.       {
  52.          updateRack(numberKey,_root.currentSweet);
  53.          actionFilled = true;
  54.       }
  55.    }
  56.    if(action == "till" && actionServed == false && _root.currentSweet < 0)
  57.    {
  58.       serveTill();
  59.       actionServed = true;
  60.    }
  61.    if(action == "dispenser" && actionCollected == false && _root.currentSweet < 0)
  62.    {
  63.       _root.dispensing = true;
  64.       dispenseSweet();
  65.       actionCollected = true;
  66.    }
  67. }
  68.